package org.shj.book2.chapter12.active;


class Servant implements ActiveObject{

	public Result makeString(int count, char fillchar){
		char[] buffer = new char[count];
		for(int i = 0 ; i < count; i++){
			buffer[i] = fillchar;
			try{
				Thread.sleep(100);
			}catch(InterruptedException e){
				
			}
		}
		return new RealResult(new String(buffer));
	}
	
	public void displayString(String str){
		try{
			System.out.println("displayString: " + str);
			Thread.sleep(10);
			
		}catch(InterruptedException e){
			
		}
	}
}
